# https://www.bilibili.com/video/BV1W7411G7wP/?p=9&spm_id_from=pageDriver&vd_source=8bd7b24b38e3e12c558d839b352b32f4
# 柱图 相同版本使用matplotlib实现
import pandas as pd
import matplotlib.pyplot as plt

students = pd.read_excel('../resources/input_py_tools/009/Students.xlsx')
students.sort_values(by='Number', inplace=True, ascending=False)
print(students)

plt.bar(students.Field, students.Number, color='orange')
plt.xticks(students.Field, rotation='vertical')
plt.xlabel('Field')
plt.ylabel('Number')
plt.title('Internaltional Students by Field', fontsize=16)
plt.tight_layout()
plt.show()